﻿using System;
using System.Data;
using System.Collections.Generic;

namespace BaseServer.BRL
{
	public partial class Sale : JWFW.BOL.BaseEntity
	{
		public Sale()
		{
			m_tableName = "t_sale";
			m_hasComment = true;
			m_tblCacheManager.IsEnable = true;
		}

		protected int m_clientID = 0;
		protected int m_toolID = 0;
		protected string m_serialNumber = string.Empty;
		protected string m_regCode = string.Empty;
		protected string m_specialInfo = string.Empty;
		protected double m_amount = 0.0;
		protected DateTime m_endDate = DateTime.MinValue;
		protected int m_couponID = 0;
		protected double m_price = 0.0;
		protected double m_discount = 0.0;
		protected string m_av = string.Empty;
		protected string m_pv = string.Empty;
		protected string m_dv = string.Empty;

		/// <summary>
		/// 用户ID
		/// </summary>
		public int ClientID
		{
			get { return m_clientID; }
			set { m_clientID = value; }
		}
		/// <summary>
		/// 工具ID
		/// </summary>
		public int ToolID
		{
			get { return m_toolID; }
			set { m_toolID = value; }
		}
		/// <summary>
		/// 序列号
		/// </summary>
		public string SerialNumber
		{
			get { return m_serialNumber; }
			set { m_serialNumber = value; }
		}
		/// <summary>
		/// 注册码
		/// </summary>
		public string RegCode
		{
			get { return m_regCode; }
			set { m_regCode = value; }
		}
		/// <summary>
		/// 额外信息
		/// </summary>
		public string SpecialInfo
		{
			get { return m_specialInfo; }
			set { m_specialInfo = value; }
		}
		/// <summary>
		/// 付款额
		/// </summary>
		public double Amount
		{
			get { return m_amount; }
			set { m_amount = value; }
		}
		/// <summary>
		/// 结束使用日期
		/// </summary>
		public DateTime EndDate
		{
			get { return m_endDate; }
			set { m_endDate = value; }
		}
		/// <summary>
		/// 优惠券ID
		/// </summary>
		public int CouponID
		{
			get { return m_couponID; }
			set { m_couponID = value; }
		}
		/// <summary>
		/// 原始价格
		/// </summary>
		public double Price
		{
			get { return m_price; }
			set { m_price = value; }
		}
		/// <summary>
		/// 折扣额
		/// </summary>
		public double Discount
		{
			get { return m_discount; }
			set { m_discount = value; }
		}
		/// <summary>
		/// 
		/// </summary>
		public string Av
		{
			get { return m_av; }
			set { m_av = value; }
		}
		/// <summary>
		/// 
		/// </summary>
		public string Pv
		{
			get { return m_pv; }
			set { m_pv = value; }
		}
		/// <summary>
		/// 
		/// </summary>
		public string Dv
		{
			get { return m_dv; }
			set { m_dv = value; }
		}

		protected override void FillContainer()
		{
			base.FillContainer();
			m_container.Add("clientID", m_clientID);
			m_container.Add("toolID", m_toolID);
			m_container.Add("serialNumber", m_serialNumber);
			m_container.Add("regCode", m_regCode);
			m_container.Add("specialInfo", m_specialInfo);
			m_container.Add("amount", m_amount);
			m_container.Add("endDate", m_endDate);
			m_container.Add("couponID", m_couponID);
			m_container.Add("price", m_price);
			m_container.Add("discount", m_discount);
			m_container.Add("av", m_av);
			m_container.Add("pv", m_pv);
			m_container.Add("dv", m_dv);
		}

		public override bool GetProperties(System.Data.DataRow record)
		{
			if(!base.GetProperties(record))
			{
				return false;
			}
			m_clientID = this.GetIntValue(record, "clientID");
			m_toolID = this.GetIntValue(record, "toolID");
			m_serialNumber = this.GetStringValue(record, "serialNumber");
			m_regCode = this.GetStringValue(record, "regCode");
			m_specialInfo = this.GetStringValue(record, "specialInfo");
			m_amount = this.GetDoubleValue(record, "amount");
			m_endDate = this.GetDateValue(record, "endDate");
			m_couponID = this.GetIntValue(record, "couponID");
			m_price = this.GetDoubleValue(record, "price");
			m_discount = this.GetDoubleValue(record, "discount");
			m_av = this.GetStringValue(record, "av");
			m_pv = this.GetStringValue(record, "pv");
			m_dv = this.GetStringValue(record, "dv");
			return true;
		}

	}
}
